home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-05
/
scnsrv.zip
/
NEWNOV.H
< prev
next >
Wrap
Text File
|
1992-10-23
|
5KB
|
200 lines
#ifndef _H_NOVELL
#define _H_NOVELL
#define NOVELL_N_DRIVES 32 // number of Netware drives, including temps
#define GDH_MASK(x) ((x)&0xFF00)
#define GDH_HANDLE(x) ((x)&0xFF)
#define GDH_UNMAPPED 0x0000 // Get Dir Handle: drive is unmapped
#define GDH_MAP_PERM 0x0100 // Get Dir Handle: permanent mapping
#define GDH_MAP_TEMP 0x0200 // Get Dir Handle: temporary mapping
#define GDH_LOCAL 0x8000 // Get Dir Handle: local drive.
#define ADH_PERM 0x12 // Allocate dir handle: perm op code
#define ADH_TEMP 0x13 // Allocate dir handle: temp op code
#define ADH_DEALLOC 0x14 // Allocate dir handle: deallocate!
#define NERR_NOVOL 0x98 // volume does not exist
#define NERR_BADDH 0x9B // bad directory handle
#define NERR_BADPATH 0x9C // invalid path
#define NERR_NODRIVE 0xF7 // drive doesn't exist
#define NERR_NOPATH 0xFF // path no locatable
#define NERR_BINDLOK 0xFE // bindery locked
#define NERR_NOCONN 0xF8 // no connection to fileserver
#define BYTE unsigned char
#define WORD unsigned int
#define LONG unsigned long
#define DROW unsigned int // backwards (swapped-byte) WORD
#define GNOL unsigned long // backwards LONG
struct GetDirectoryPathRequest { // 0xE2 01
WORD length;
BYTE reqFcnCode; // s/b = 1
BYTE dirHandle;
};
struct GetDirectoryPathReply {
DROW length; // minus two... hi-lo, not low/hi
BYTE dirPathLen;
BYTE path[255];
};
struct GetVolumeNameRequest {
WORD length;
BYTE function; // s/b 06
BYTE volNumber;
};
struct GetVolumeNameReply {
WORD length;
BYTE volnameLength;
BYTE volName[16];
};
struct AllocateDirHandleRequest {
WORD length; // sizeof (this struct) - 2
BYTE reqFcnCode; // 0x12 for permanent 0x13 for temporary
BYTE dirHandle;
BYTE driveLetter;
BYTE pathLength;
BYTE path[255];
};
struct NovellReply {
WORD length; // minus two, of course
BYTE newDirHandle;
BYTE effRightsMask;
};
struct ConnectionIDTable {
BYTE slotInUse;
BYTE serverOrderNumber;
BYTE serverNetAddr[4];
BYTE physicalNodeAddr[6];
BYTE socketNumber[2];
BYTE receiveTimeout[2];
BYTE routerPNA[6];
BYTE packetSequenceNumber;
BYTE connectionNumber;
BYTE connectionStatus;
BYTE maxTimeout[2];
BYTE filler[5];
};
struct DriveConnectionIDTable {
BYTE connID[NOVELL_N_DRIVES];
};
struct FileServerNameTable {
BYTE ServerName[8][48];
};
// Get File Info
struct NovellFileInfo {
BYTE filename[14];
DROW seqnum;
BYTE fileAttributes;
BYTE extendedFileAttributes;
WORD creationDate;
WORD accessDate;
LONG updateTime;
LONG ownerID;
LONG archiveTime;
LONG fileSize;
BYTE reserved_buf[56];
};
struct GetFileInfoRequest {
WORD length; // minus two, of course
BYTE function; // s/b 0x0F
DROW seqnum;
BYTE dirHandle;
BYTE searchAttribs;
BYTE pathLen;
BYTE path[255];
};
struct GetFileInfoReply {
WORD length; // minus two
DROW seqnum;
BYTE filename[14];
BYTE fileAttributes;
BYTE extendedFileAttributes;
GNOL fileSize;
WORD creationDate;
WORD accessDate;
LONG updateTime;
GNOL ownerID;
LONG archiveTime;
BYTE reserved_buf[56];
};
struct ScanDirInfoRequest {
WORD length; // minus two, of course
BYTE function; // s/b 0x02
BYTE dirHandle;
WORD subdirNumber; // start with zero, then increment on repeat
BYTE pathLen;
BYTE path[255];
};
struct ScanDirInfoReply {
WORD length; // minus two
BYTE filename[16];
GNOL creationDate;
GNOL ownerID;
BYTE rightsMask;
BYTE reserved;
WORD subdirNumber;
};
// Set File Info
struct SetFileInfoRequest {
WORD length; // minus two, of course
BYTE function; // s/b 0x10
BYTE fileAttributes;
BYTE extendedFileAttributes;
GNOL reserved;
WORD creationDate;
WORD accessDate;
LONG updateTime;
GNOL ownerID;
LONG archiveTime;
BYTE reserved_buf[56];
BYTE dirHandle;
BYTE searchAttribs;
BYTE pathLen;
BYTE path[255];
};
// Procedure decl's
int GetDirectoryHandle(int driveNumber);
int GetPreferredConnectionID(void);
void SetPreferredConnectionID(int connectionID);
struct ConnectionIDTable far *GetConnIDTable(void);
struct FileServerNameTable far *GetFSNameTable(void);
int GetConnectionID(char *serverName, int *connectionID);
int FindMappedDrive(char *serverName, char *volumeName, char *path);
int AllocateDirHandle(char *volumeName, int drive, int handle, int opcode);
int GetDirectoryPath(int dirHandle, char *pathOutBuf);
void DumpDriveMapping(void);
int NovMapDrive(int *drive, char *server, char *volume);
int NovUnMapDrive(int drive, char *server);
int SetFileInfo(char *path, struct NovellFileInfo *nfip);
int GetFileInfo(char *path, struct NovellFileInfo *nfip, int seqnum);
int GetDirInfo(char *path, struct ScanDirInfoReply *dip);
int GetNextServer(char *serverName, int *connectionIDP);
int GetVolumeName(char *volName, int volIndex);
unsigned int IntSwap(unsigned int t);
unsigned long LongSwap(unsigned long t);
#endif